package com.czx.user.controller;

import com.czx.core.web.domain.R;
import com.czx.user.domain.entity.User;
import com.czx.user.feign.TaskFeignService;
import com.czx.user.feign.dto.TaskFeignDTO;
import com.czx.user.service.UserService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/user")
public class UserController {

    @Resource
    private UserService userService;

    @Resource
    private TaskFeignService taskFeignService;

    @GetMapping("/getInfo")
    public R<List<User>> getInfo(){
        List<User> list = userService.list();
        return R.ok(list);
    }
    //测试远程调用
    @GetMapping("/gettask")
    public R gettaskInfo(Long id){
        return R.ok(taskFeignService.getTaskById(id));
    }
}